Avoid silently losing mail via fakemail.
authorRob Browning <rlb@defaultvalue.org>
Tue, 5 Apr 2011 03:46:27 +0000 (22:46 -0500)
committerRob Browning <rlb@defaultvalue.org>
Thu, 7 Apr 2011 05:49:44 +0000 (00:49 -0500)
commit7ab2699f68cd8227e58bc2177cc48b4239eb929e
tree08e3d7ff3447e9a0e7c767b707c1c1f7b1655f1c
parent0f624911022e9a8a544eb527054c6178fe713100
Avoid silently losing mail via fakemail.

An attempt is made to avoid silently losing mail via fakemail.

This fix attempts to avoid a situation where Emacs can silently lose
mail.  This can occur if sendmail.el (at least) falls back to
fakemail, and the underlying binary (MAIL_PROGRAM_NAME) that fakemail
is configured to use doesn't exist.  Unless mail-interactive is true,
Emacs won't wait for the mailer and so won't know that fakemail
failed.

For now, Debian sets fakemail's MAIL_PROGRAM_NAME to /usr/bin/mail
(which is the correct value for Debian systems) rather than /bin/mail.
Debian also adjusts Emacs to test whether or not /usr/bin/mail exists
and is executable.  If either of these tests fail, then
mail-interactive is set to t.  That should ensure that a user will
actually see an error if they attempt to use the broken fakemail.

Note that Debian actually forces the MAIL_PROGRAM_NAME value to
/usr/bin/mail.  The build will fail if any other value is specified.
This is done to ensure that MAIL_PROGRAM_NAME isn't accidentally set
to some other value during the build process.  If this is undesirable
for some reason, just comment out avoid-fakemail-loss.diff in
debian/patches/series.

Author: Rob Browning <rlb@defaultvalue.org>
Added-by: Rob Browning <rlb@defaultvalue.org>
lib-src/fakemail.c
lisp/gnus/message.el
lisp/mail/feedmail.el
lisp/mail/sendmail.el